package fr.umlv.j2ee.patterns.transfertobject;

import javax.naming.InitialContext;

public class Client {

	
	
	public static void main(String[] args) throws Exception {
		
//		on recupere le contexte initial, configurer avec le jndi.properties
		InitialContext ctx = new InitialContext();
		//on recupere l'interface metier
		BusinessObject business = (BusinessObject) ctx.lookup("BusinessObjectEJB/remote");

		
		Account ac1 = new Account("firstName","lastName","plop@plop.com");
		Account ac2 = new Account("tim","burton","tim.burton@universal.com");
		//on ajoute des transfert object
		business.addAccount(ac1);
		business.addAccount(ac2);
		
		//on recupere les transfert object
		System.out.println("accounts list "+business.list());
		System.out.println("account "+business.getAccountData("plop@plop.com"));
		
	}
}
